from tkinter import *
from tkinter import ttk  #导入ttk模块，因为Combobox下拉菜单控件在ttk中
root = Tk()
root.title("串口调试助手")
root.geometry("300x200")

Label(root,text = "串口设置",width = 10).grid(row = 0,column = 1)
Label(root,text = "串口号").grid(row = 1,column = 1)
Label(root,text = "波特率").grid(row = 2,column = 1)
Label(root,text = "数据位").grid(row = 3,column = 1)
Label(root,text = "校验位").grid(row = 4,column = 1)
Label(root,text = "停止位").grid(row = 5,column = 1)
com_num = ttk.Combobox(root,width = 8)
com_num["value"] = ("COM1","COM2","COM3","COM4")
com_num.grid(row = 1,column = 2)

baudrate = ttk.Combobox(root,width = 8)
baudrate["value"] = ("9600","19200","115200","921600")
baudrate.grid(row = 2,column = 2)

databit = ttk.Combobox(root,width = 8)
databit["value"] = ("8","9")
databit.grid(row = 3,column = 2)

parity = ttk.Combobox(root,width = 8)
parity["value"] = ("无","奇校验","偶校验")
parity.grid(row = 4,column = 2)

stopbits = ttk.Combobox(root,width = 8)
stopbits["value"] = ("1","1.5","2")
stopbits.grid(row = 5,column = 2)
mainloop()
